﻿"""
Definition of urls for JobRecord.
"""

from datetime import datetime
from django.conf.urls import patterns, url, include
from app.forms import BootstrapAuthenticationForm
from django.contrib import admin
import app.views
import django.contrib.auth.views

# Uncomment the next lines to enable the admin:
from django.conf.urls import include
from django.contrib import admin
admin.autodiscover()

urlpatterns = [
    url(r'^$', app.views.home, name='home'),
    url(r'^settings$', app.views.settings, name='settings'),
    url(r'^about', app.views.about, name='about'),
    url(r'^login/$',
        django.contrib.auth.views.login,
        {
            'template_name': 'app/login.html',
            'authentication_form': BootstrapAuthenticationForm,
            'extra_context':
            {
                'title':'用户登录',
                'year':datetime.now().year,
            }
        },
        name='login'),
    url(r'^logout$',
        django.contrib.auth.views.logout,
        {
            'next_page': '/',
        },
        name='logout'),

    # Uncomment the admin/doc line below to enable admin documentation:
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^diary$', app.views.diary, name='diary'),
    url(r'^locale_diary$', app.views.locale_diary, name='locale_diary'),
    url(r'^weekly$', app.views.weekly, name='weekly'),

    url(r'^diary/m/del/(?P<id>\d+)/$', app.views.remove_m_diary, name='remove_m_diary'),
    url(r'^diary/m/edt/(?P<id>\d+)/$', app.views.edit_m_diary, name='edit_m_diary'),
    url(r'^diary$/d/edt/(?P<id>\d+)/$', app.views.edit_d_diary, name='edit_d_diary'),
    url(r'^diary/d/del/(?P<id>\d+)/$', app.views.remove_d_diary, name='remove_d_diary'),
]
